﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System.Collections.Generic;
using System.Linq;
using FinPlusInterfaces;

namespace FinPlusCompCore
{
    public static class PodHelpers
    {
        public static IList<IBean> ToList(this IPod pod, string match, bool isValMatch = true)
        {
            if (isValMatch)
                return pod.Where(i => i.ToString().Equals(match)).ToList();

            return pod.Where(i => i.Name.Equals(match)).ToList();
        }
    }
}
